package com.atguigu.cms.controller;

import com.atguigu.cms.entity.CrmBanner;
import com.atguigu.cms.service.CrmBannerService;

import com.atguigu.common.Result;
import com.sun.org.apache.regexp.internal.RE;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


/**
 * 前台banner显示接口
 * @author Summerday
 */

@RestController
@RequestMapping("/eduCms/bannerFront")
public class BannerFrontController {

    @Resource
    private CrmBannerService bannerService;

    @ApiOperation(value = "获取所有banner")
    @GetMapping("/getAll")
    public Result getAll(){
        List<CrmBanner> bannerList =  bannerService.listAll();
        return Result.ok().data("list",bannerList);
    }
}
